package com.finalcial.util;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class UploadUtil {
	private UploadUtil() {
		
	};
	public static long getFileSizes(File f){//取得文件大小
        long s=0;
        if (f.exists()) {
            FileInputStream fis = null;
            try {
				fis = new FileInputStream(f);
				s = fis.available();
			} catch (FileNotFoundException e) {
				e.printStackTrace();
			} catch (IOException e) {
				e.printStackTrace();
			}
        } else {
            try {
				f.createNewFile();
			} catch (IOException e) {
				e.printStackTrace();
			}
            System.out.println("文件不存在");
        }
        return s;
    }
}
